package com.sanqi.work.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.sanqi.work.mapper.WorkStepLevelPriceMapper;
import com.sanqi.work.domain.WorkStepLevelPrice;
import com.sanqi.work.manager.IWorkStepLevelPriceManager;
import com.sanqi.work.service.IWorkStepLevelPriceService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

/**
 * 工作计件阶梯价格Service业务层处理
 * 
 * @author duany
 * @date 2025-10-08
 */
@Service
public class WorkStepLevelPriceServiceImpl extends ServiceImpl<WorkStepLevelPriceMapper, WorkStepLevelPrice> implements IWorkStepLevelPriceService 
{
    @Autowired
    private WorkStepLevelPriceMapper workStepLevelPriceMapper;
    @Autowired
    private IWorkStepLevelPriceManager workStepLevelPriceManager;

    /**
     * 查询工作计件阶梯价格
     * 
     * @param id 工作计件阶梯价格主键
     * @return 工作计件阶梯价格
     */
    @Override
    public WorkStepLevelPrice selectWorkStepLevelPriceById(String id)
    {
        return workStepLevelPriceMapper.selectWorkStepLevelPriceById(id);
    }

    /**
     * 查询工作计件阶梯价格列表
     * 
     * @param workStepLevelPrice 工作计件阶梯价格
     * @return 工作计件阶梯价格
     */
    @Override
    public List<WorkStepLevelPrice> selectWorkStepLevelPriceList(WorkStepLevelPrice workStepLevelPrice)
    {
        return workStepLevelPriceMapper.selectWorkStepLevelPriceList(workStepLevelPrice);
    }

    /**
     * 新增工作计件阶梯价格
     * 
     * @param workStepLevelPrice 工作计件阶梯价格
     * @return 结果
     */
    @Override
    public int insertWorkStepLevelPrice(WorkStepLevelPrice workStepLevelPrice)
    {
        return save(workStepLevelPrice) ? 1 : 0;
    }

    /**
     * 修改工作计件阶梯价格
     * 
     * @param workStepLevelPrice 工作计件阶梯价格
     * @return 结果
     */
    @Override
    public int updateWorkStepLevelPrice(WorkStepLevelPrice workStepLevelPrice)
    {
        return updateById(workStepLevelPrice) ? 1 : 0;
    }

    /**
     * 批量删除工作计件阶梯价格
     * 
     * @param ids 需要删除的工作计件阶梯价格主键
     * @return 结果
     */
    @Override
    public int deleteWorkStepLevelPriceByIds(String[] ids)
    {
        return workStepLevelPriceMapper.deleteWorkStepLevelPriceByIds(ids);
    }

    /**
     * 删除工作计件阶梯价格信息
     * 
     * @param id 工作计件阶梯价格主键
     * @return 结果
     */
    @Override
    public int deleteWorkStepLevelPriceById(String id)
    {
        return workStepLevelPriceMapper.deleteWorkStepLevelPriceById(id);
    }

    @Override
    public int removeByLevelId(String levelId) {
        return workStepLevelPriceManager.removeByLevelId(levelId);
    }

    @Override
    public List<WorkStepLevelPrice> queryByLevelId(String levelId) {
        return workStepLevelPriceManager.queryByLevelId(levelId);
    }

    @Override
    public List<WorkStepLevelPrice> queryByLevelIds(List<String> levelIds) {
        return workStepLevelPriceManager.queryByLevelIds(levelIds);
    }
}
